package com.app.project;

import java.sql.ResultSet;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;


public class Map_LoginActivity extends Activity{
	
	Connect con = new Connect(); 
	ResultSet rs;
	String   OID
			,PacketName
			,CustomerName
			,CustomerPassword
			,CustomerTimeCount;
	
	BESM_BluetoothConnect Bluetooth = new BESM_BluetoothConnect();
	
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_login);
		//CheckBluetooth();
		
		
		TextView SegwayName = (TextView) findViewById(R.id.Textview_SegwayName);
		SegwayName.setText("SegwayName :");
	//-----------------------------Button_OK--------------------------------//		
//		final Button OK = (Button) findViewById(R.id.buttonLogin);
//		OK.setOnClickListener(new View.OnClickListener() {
//		
//			@Override
//			public void onClick(View v) {
//				EditText getpassword = (EditText) findViewById(R.id.editTextLogin);
//				String password = getpassword.getText().toString();
//				// TODO Auto-generated method stub
//				rs = con.selectData("SELECT * FROM Customers WHERE CustomerPassword ='"+password+"' " +
//						"AND IsDeleted= '0' ");
//		
//				try {
//					if (rs.next()) {
//				
//						OID = rs.getString("OID");
//						PacketName = rs.getString("PacketName");
//						CustomerName = rs.getString("CustomerName");
//						CustomerPassword = rs.getString("CustomerPassword");
//						CustomerTimeCount = rs.getString("CustomerTimeCount");
//				
//						if(password.equals(CustomerPassword)){
//							Intent newActivity = new Intent(Map_LoginActivity.this,MainActivity.class);
//							// input = true;
//							newActivity.putExtra("OID", OID);
//							newActivity.putExtra("PacketName", PacketName);
//							newActivity.putExtra("CustomerName", CustomerName);
//							newActivity.putExtra("CustomerTimeCount", CustomerTimeCount);
//						
//							startActivity(newActivity);
//							//finish();
//                    
//							Toast.makeText(Map_LoginActivity.this,"Well Come : "+CustomerName ,
//									Toast.LENGTH_SHORT).show(); 
//						}else{
//						}
//						Toast.makeText(Map_LoginActivity.this,CustomerName ,
//	    	 		    Toast.LENGTH_SHORT).show(); 
//	            
//					}
//				} catch (Exception e) {
//						Toast.makeText(Map_LoginActivity.this,e.toString() ,
//						Toast.LENGTH_LONG).show(); 
//				}
//			}
//		
//		});
//
	}
	
}
